def number(num):
    # 如果数字是负数，则不是回文数（因为带有负号）
    if num < 0:
        return False

    # 将数字转换为字符串
    str_num = str(num)

   # 检查字符串是否等于其反转后的字符串
    return str_num == str_num[::-1]

# 测试
print(number(6776))  # 输出: True
print(number(123454321))  # 输出: True
print(number(-12321))  # 输出: False, 负数不被认为是回文数
print(number(123456))  # 输出: False
